using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class MenuListPanel : BasePanel
{
    [SerializeField] private Button resumeButton;
    [SerializeField] private Button settingButton;
    [SerializeField] private Button exitButton;
    
        
    //
    private void Start()
    {
        resumeButton.onClick.AddListener(ResumeAction);
        settingButton.onClick.AddListener(SettingAction);
        exitButton.onClick.AddListener(ExitAction);
    }

    //
    private void ResumeAction()
    {
        // 时间恢复
        Time.timeScale = 1.0f;
        // 关闭页面
        UIManager.Instance.ClosePanel(UIConst.PANEL_MENULIST);
    }
    
    //
    private void SettingAction()
    {
        // 打开设置页面
        UIManager.Instance.OpenPanel(UIConst.PANEL_SETTING);
    }
    
    //
    private void ExitAction()
    {
        // 回到主界面
        EventCenter.Instance.EventTrigger(EventName.EVENT_SCENE_SCENESWITE, 0);
    }
}
